import { FC, createContext, useState } from 'react';
import { Icontext, Itodo } from './data';
const Empt: unique symbol = Symbol();

export const context = createContext<Icontext | typeof Empt>(Empt)

export const { Provider, Consumer } = context


const Prv: FC = (props) => {
  const [todoList, setTodoList] = useState<Itodo[]>([{
    value: 'sdgaefa',
    complate: false,
    id: '00001'
  }])
  const addTodo = (vale: Itodo) => {

  }
  return (
    <Provider value={{ addTodo, todoList }}>
      {props.children}
    </Provider>
  )

}

export default Prv